home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_4.adf / Compiler_Headers / Include / intuition / gadgetclass.h < prev    next >
C/C++ Source or Header  |  1992-07-30  |  8KB  |  249 lines

  1. #ifndef INTUITION_GADGETCLASS_H
  2. #define INTUITION_GADGETCLASS_H 1
  3. /*
  4. **  $Filename: intuition/gadgetclass.h $
  5. **  $Release: 2.04 Includes, V37.4 $
  6. **  $Revision: 36.6 $
  7. **  $Date: 91/11/08 $
  8. **
  9. **  Custom and 'boopsi' gadget class interface
  10. **
  11. **  (C) Copyright 1989-1991 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef INTUITION_INTUITION_H
  20. #include <intuition/intuition.h>
  21. #endif
  22.  
  23. #ifndef UTILITY_TAGITEM_H
  24. #include <utility/tagitem.h>
  25. #endif
  26.  
  27. /*
  28.  * NOTE:  <intuition/iobsolete.h> is included at the END of this file!
  29.  */
  30.  
  31. /* Gadget Class attributes    */
  32.  
  33. #define       GA_Dummy        (TAG_USER +0x30000)
  34. #define    GA_Left        (GA_Dummy + 0x0001)
  35. #define    GA_RelRight        (GA_Dummy + 0x0002)
  36. #define    GA_Top        (GA_Dummy + 0x0003)
  37. #define    GA_RelBottom        (GA_Dummy + 0x0004)
  38. #define    GA_Width        (GA_Dummy + 0x0005)
  39. #define    GA_RelWidth        (GA_Dummy + 0x0006)
  40. #define    GA_Height        (GA_Dummy + 0x0007)
  41. #define    GA_RelHeight        (GA_Dummy + 0x0008)
  42. #define    GA_Text        (GA_Dummy + 0x0009) /* ti_Data is (UBYTE *) */
  43. #define    GA_Image        (GA_Dummy + 0x000A)
  44. #define    GA_Border        (GA_Dummy + 0x000B)
  45. #define    GA_SelectRender    (GA_Dummy + 0x000C)
  46. #define    GA_Highlight        (GA_Dummy + 0x000D)
  47. #define    GA_Disabled        (GA_Dummy + 0x000E)
  48. #define    GA_GZZGadget        (GA_Dummy + 0x000F)
  49. #define    GA_ID        (GA_Dummy + 0x0010)
  50. #define    GA_UserData        (GA_Dummy + 0x0011)
  51. #define    GA_SpecialInfo    (GA_Dummy + 0x0012)
  52. #define    GA_Selected        (GA_Dummy + 0x0013)
  53. #define    GA_EndGadget        (GA_Dummy + 0x0014)
  54. #define    GA_Immediate        (GA_Dummy + 0x0015)
  55. #define    GA_RelVerify        (GA_Dummy + 0x0016)
  56. #define    GA_FollowMouse    (GA_Dummy + 0x0017)
  57. #define    GA_RightBorder    (GA_Dummy + 0x0018)
  58. #define    GA_LeftBorder    (GA_Dummy + 0x0019)
  59. #define    GA_TopBorder        (GA_Dummy + 0x001A)
  60. #define    GA_BottomBorder    (GA_Dummy + 0x001B)
  61. #define    GA_ToggleSelect    (GA_Dummy + 0x001C)
  62.  
  63.     /* internal use only, until further notice, please */
  64. #define    GA_SysGadget        (GA_Dummy + 0x001D)
  65.     /* bool, sets GTYP_SYSGADGET field in type    */
  66. #define    GA_SysGType        (GA_Dummy + 0x001E)
  67.     /* e.g., GTYP_WUPFRONT, ...    */
  68.  
  69. #define    GA_Previous        (GA_Dummy + 0x001F)
  70.     /* previous gadget (or (struct Gadget **)) in linked list
  71.      * NOTE: This attribute CANNOT be used to link new gadgets
  72.      * into the gadget list of an open window or requester.
  73.      * You must use AddGList().
  74.      */
  75.  
  76. #define    GA_Next        (GA_Dummy + 0x0020)
  77.      /* not implemented */
  78.  
  79. #define    GA_DrawInfo        (GA_Dummy + 0x0021)
  80.     /* some fancy gadgets need to see a DrawInfo
  81.      * when created or for layout
  82.      */
  83.  
  84. /* You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage */
  85. #define GA_IntuiText        (GA_Dummy + 0x0022)
  86.     /* ti_Data is (struct IntuiText    *) */
  87.  
  88. #define GA_LabelImage        (GA_Dummy + 0x0023)
  89.     /* ti_Data is an image (object), used in place of
  90.      * GadgetText
  91.      */
  92.  
  93. #define GA_TabCycle        (GA_Dummy + 0x0024)
  94.     /* New for V37:
  95.      * Boolean indicates that this gadget is to participate in
  96.      * cycling activation with Tab or Shift-Tab.
  97.      */
  98.  
  99. /* PROPGCLASS attributes */
  100.  
  101. #define PGA_Dummy    (TAG_USER + 0x31000)
  102. #define PGA_Freedom    (PGA_Dummy + 0x0001)
  103.     /* only one of FREEVERT or FREEHORIZ */
  104. #define PGA_Borderless    (PGA_Dummy + 0x0002)
  105. #define PGA_HorizPot    (PGA_Dummy + 0x0003)
  106. #define PGA_HorizBody    (PGA_Dummy + 0x0004)
  107. #define PGA_VertPot    (PGA_Dummy + 0x0005)
  108. #define PGA_VertBody    (PGA_Dummy + 0x0006)
  109. #define PGA_Total    (PGA_Dummy + 0x0007)
  110. #define PGA_Visible    (PGA_Dummy + 0x0008)
  111. #define PGA_Top        (PGA_Dummy + 0x0009)
  112. /* New for V37: */
  113. #define PGA_NewLook    (PGA_Dummy + 0x000A)
  114.  
  115. /* STRGCLASS attributes    */
  116.  
  117. #define STRINGA_Dummy            (TAG_USER      +0x32000)
  118. #define STRINGA_MaxChars    (STRINGA_Dummy + 0x0001)
  119. #define STRINGA_Buffer        (STRINGA_Dummy + 0x0002)
  120. #define STRINGA_UndoBuffer    (STRINGA_Dummy + 0x0003)
  121. #define STRINGA_WorkBuffer    (STRINGA_Dummy + 0x0004)
  122. #define STRINGA_BufferPos    (STRINGA_Dummy + 0x0005)
  123. #define STRINGA_DispPos        (STRINGA_Dummy + 0x0006)
  124. #define STRINGA_AltKeyMap    (STRINGA_Dummy + 0x0007)
  125. #define STRINGA_Font        (STRINGA_Dummy + 0x0008)
  126. #define STRINGA_Pens        (STRINGA_Dummy + 0x0009)
  127. #define STRINGA_ActivePens    (STRINGA_Dummy + 0x000A)
  128. #define STRINGA_EditHook    (STRINGA_Dummy + 0x000B)
  129. #define STRINGA_EditModes    (STRINGA_Dummy + 0x000C)
  130.  
  131. /* booleans */
  132. #define STRINGA_ReplaceMode    (STRINGA_Dummy + 0x000D)
  133. #define STRINGA_FixedFieldMode    (STRINGA_Dummy + 0x000E)
  134. #define STRINGA_NoFilterMode    (STRINGA_Dummy + 0x000F)
  135.  
  136. #define STRINGA_Justification    (STRINGA_Dummy + 0x0010)
  137.     /* GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT */
  138. #define STRINGA_LongVal        (STRINGA_Dummy + 0x0011)
  139. #define STRINGA_TextVal        (STRINGA_Dummy + 0x0012)
  140.  
  141. #define STRINGA_ExitHelp    (STRINGA_Dummy + 0x0013)
  142.     /* STRINGA_ExitHelp is new for V37, and ignored by V36.
  143.      * Set this if you want the gadget to exit when Help is
  144.      * pressed.  Look for a code of 0x5F, the rawkey code for Help
  145.      */
  146.  
  147. #define SG_DEFAULTMAXCHARS    (128)
  148.  
  149. /* Gadget Layout related attributes    */
  150.  
  151. #define    LAYOUTA_Dummy        (TAG_USER  + 0x38000)
  152. #define LAYOUTA_LayoutObj    (LAYOUTA_Dummy + 0x0001)
  153. #define LAYOUTA_Spacing        (LAYOUTA_Dummy + 0x0002)
  154. #define LAYOUTA_Orientation    (LAYOUTA_Dummy + 0x0003)
  155.  
  156. /* orientation values    */
  157. #define LORIENT_NONE    0
  158. #define LORIENT_HORIZ    1
  159. #define LORIENT_VERT    2
  160.  
  161.  
  162. /* Gadget Method ID's    */
  163.  
  164. #define GM_Dummy    (-1)    /* not used for anything        */
  165. #define GM_HITTEST    (0)    /* return GMR_GADGETHIT if you are clicked on
  166.                  * (whether or not you are disabled).
  167.                  */
  168. #define GM_RENDER    (1)    /* draw yourself, in the appropriate state */
  169. #define GM_GOACTIVE    (2)    /* you are now going to be fed input    */
  170. #define GM_HANDLEINPUT    (3)    /* handle that input            */
  171. #define GM_GOINACTIVE    (4)    /* whether or not by choice, you are done  */
  172.  
  173. /* Parameter "Messages" passed to gadget class methods    */
  174.  
  175. /* GM_HITTEST    */
  176. struct gpHitTest {
  177.     ULONG        MethodID;
  178.     struct GadgetInfo    *gpht_GInfo;
  179.     struct {
  180.     WORD    X;
  181.     WORD    Y;
  182.     }            gpht_Mouse;
  183. };
  184. /* GM_HITTEST return value */
  185. #define GMR_GADGETHIT    (0x00000004)    /* if no hit, return 0 */
  186.  
  187. /* GM_RENDER    */
  188. struct gpRender {
  189.     ULONG        MethodID;
  190.     struct GadgetInfo    *gpr_GInfo;    /* gadget context        */
  191.     struct RastPort    *gpr_RPort;    /* all ready for use        */
  192.     LONG        gpr_Redraw;    /* might be a "highlight pass"    */
  193. };
  194.  
  195. /* values of gpr_Redraw    */
  196. #define GREDRAW_UPDATE    (2)    /* incremental update, e.g. prop slider    */
  197. #define GREDRAW_REDRAW    (1)    /* redraw gadget    */
  198. #define GREDRAW_TOGGLE    (0)    /* toggle highlight, if applicable    */
  199.  
  200. /* GM_GOACTIVE, GM_HANDLEINPUT    */
  201. struct gpInput {
  202.     ULONG        MethodID;
  203.     struct GadgetInfo    *gpi_GInfo;
  204.     struct InputEvent    *gpi_IEvent;
  205.     LONG        *gpi_Termination;
  206.     struct {
  207.     WORD    X;
  208.     WORD    Y;
  209.     }            gpi_Mouse;
  210. };
  211.  
  212. /* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    */
  213. /* return GMR_MEACTIVE (0) alone if you want more input.
  214.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  215.  * GMR_VERIFY.
  216.  */
  217. #define GMR_MEACTIVE    (0)
  218. #define GMR_NOREUSE    (1 << 1)
  219. #define GMR_REUSE    (1 << 2)
  220. #define GMR_VERIFY    (1 << 3)    /* you MUST set cgp_Termination */
  221.  
  222. /* New for V37:
  223.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  224.  * which instructs Intuition to activate the next or previous gadget
  225.  * that has GFLG_TABCYCLE set.
  226.  */
  227. #define GMR_NEXTACTIVE    (1 << 4)
  228. #define GMR_PREVACTIVE    (1 << 5)
  229.  
  230. /* GM_GOINACTIVE */
  231. struct gpGoInactive {
  232.     ULONG        MethodID;
  233.     struct GadgetInfo    *gpgi_GInfo;
  234.  
  235.     /* V37 field only!    DO NOT attempt to read under V36! */
  236.     ULONG        gpgi_Abort;    /* gpgi_Abort=1 if gadget was aborted
  237.                      * by Intuition and 0 if gadget went
  238.                      * inactive at its own request
  239.                      */
  240. };
  241.  
  242.  
  243. /* Include obsolete identifiers: */
  244. #ifndef INTUITION_IOBSOLETE_H
  245. #include <intuition/iobsolete.h>
  246. #endif
  247.  
  248. #endif
  249.